// 判断是不是外部链接
export function isExternalLink(url: string): boolean {
  const regex = /https?:\/\//
  return regex.test(url)
}

// 如果是外部链接，获取出外部链接部分
export function getExternalLink(text: string): string[] {
  // 使用正则表达式匹配URL
  const regex = /https?:\/\/[^\s]+/g
  const urls = text.match(regex)
  return urls ? urls.map((url) => url.trim()) : []
}
